package com.aspose.cells;

import java.util.Iterator;

class zbqn {
   int a;
   int b;
   int c;
   int d;
   short e;
   String f;
   String g;
   PivotField h;
   boolean i;

   zbqn() {
   }

   zbqn(PivotField var1) {
      this.h = var1;
      this.i = true;
      if (this.h.isCalculatedField()) {
         this.a = 0;
      } else if (this.h.g()) {
         this.a = 0;
      } else {
         this.a = 1;
      }

      this.g = this.h.getName();
      String var2 = (zsl.j(this.a) + " of " + this.g).toLowerCase();
      int var3 = var2.length();
      int var4 = 0;
      Iterator var5 = this.h.a.a.iterator();

      while(true) {
         while(true) {
            String var7;
            do {
               do {
                  if (!var5.hasNext()) {
                     if (var4 != 0) {
                        this.g = this.g + (var4 + 1);
                     }

                     return;
                  }

                  PivotField var6 = (PivotField)var5.next();
                  var7 = var6.i.b().toLowerCase();
               } while(var7.length() < var3);
            } while(!var7.startsWith(var2));

            if (var7.length() == var3) {
               var4 = 1;
            } else {
               boolean var8 = true;
               char[] var9 = var7.toCharArray();

               int var10;
               for(var10 = var3; var10 < var9.length; ++var10) {
                  if (var9[var10] < '0' || var9[var10] > '9') {
                     var8 = false;
                     break;
                  }
               }

               if (var8) {
                  var10 = com.aspose.cells.b.a.zo.a(var7.substring(var3));
                  if (var10 > var4) {
                     var4 = var10;
                  }
               }
            }
         }
      }
   }

   void a(zbqn var1) {
      this.a = var1.a;
      this.b = var1.b;
      this.c = var1.c;
      this.d = var1.d;
      this.e = var1.e;
      this.f = var1.a();
      this.g = var1.g;
      this.i = var1.i;
   }

   String a() {
      return this.f;
   }

   void a(String var1) {
      this.f = var1;
   }

   String b() {
      return this.i ? zsl.j(this.a) + " of " + this.g : this.g;
   }

   void b(String var1) {
      this.g = var1;
      this.i = false;
   }
}
